import JT
fixedImageName = 'C:/Users/bryan/bryan-code/2D3D/vert1/fluoro/ushortim080-LAT.mhd'
movingImageName = 'C:/Users/bryan/bryan-code/trunk/Images/CalibratedDRRImage.mhd'
inputVolFileName = 'C:/Users/bryan/bryan-code/2D3D/vert1/CT/ucharCTv1r1.mha'
staFile = 'C:/Users/bryan/bryan-code/2D3D/vert1/CT/ucharCTv1r1.sta'
calFileLat = 'C:/Users/bryan/bryan-code/trunk/TestData/ext_cal1.txt'
xraycam = JT.XRayCamera()
drr = JT.DRR()
drr.SetXRayCamera(xraycam)
drr.InteractionOff()
cal = JT.ExternalCalibration()
cal.LoadConsolidatedCalibration(calFileLat)
cal.LoadStaFile(staFile)
xraycam.SetExternalCalibration(cal)
volume = JT.Volume()
volume.SetVolumeFilename(inputVolFileName)
volume.SetOriginalTransform(cal._VolumeT)
volume.SetBodyCenter((3.906, 2.17, -7.378))
drr.AddVolume(volume)
fixedImage = JT.FixedImage()
fixedImage.SetFileName(fixedImageName)
reg = JT.Registration()
reg.SetFixedImage(fixedImage.GetImage(0))
reg.SetMovingImageGenerator(drr)
reg.SetRegionOfInterest([[210,187],[277,370]])
reg.SetImageMetric('gc')
pose = (0,0,0,0,0,0)
val = reg.GetValue(pose,debug=True,plot=True)
        
